//
//  GestureVC.m
//  first
//
//  Created by 毕小强 on 17/1/10.
//  Copyright © 2017年 毕小强. All rights reserved.
//

#import "GestureVC.h"
#import "XQPhotoView.h"
#import <PhotoBrowser.h>
@interface GestureVC ()<PBViewControllerDelegate,PBViewControllerDataSource>
@property (nonatomic,strong) XQPhotoView *imageView;
@end

@implementation GestureVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    PBViewController *pbVC = [PBViewController new];
    pbVC.pb_delegate = self;
    pbVC.pb_dataSource = self;
    //[self presentViewController:pbVC animated:YES completion:nil];
    
    XQPhotoView *xqView = [[XQPhotoView alloc]initWithImage:[UIImage imageNamed:@"icon"]];
    [self.view addSubview:xqView];
}
-(NSInteger)numberOfPagesInViewController:(PBViewController *)viewController{
    return 3;
}
-(void)viewController:(PBViewController *)viewController presentImageView:(UIImageView *)imageView forPageAtIndex:(NSInteger)index progressHandler:(void (^)(NSInteger, NSInteger))progressHandler{
    imageView.image = [UIImage imageNamed:@"icon"];
}
-(void)viewController:(PBViewController *)viewController didSingleTapedPageAtIndex:(NSInteger)index presentedImage:(UIImage *)presentedImage{
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
